package com.example.mapper;

import com.example.entity.User;
import com.example.service.SqlProvider;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author:0xOO
 * @Date: 2018/9/26 0026
 * @Time: 15:20
 */
@Repository
public interface UserMapper {

    User selectById(int id);

    int insert(User user);
    @InsertProvider(type = SqlProvider.class, method = "insertListSQL")
    int insertBatchSQL(List<User> userList);
    void insertBatch(List<User> userList);

    List<User> selectUser();

    Page<User> findByPage(@Param("pageStart") int pageStart,@Param("pageSize")int pageSize);
}
